﻿@model IEnumerable<YogaStudio.Data.Domain.Faculty>

@{
    ViewBag.Title = "Index";
}

<div class="main">
    <div class="content">
        <div class="section group">
            <div class="col span_2_of_3">
                <div class="contact-form">
                    @if (TempData["AccountAreadyExist"] != null && (bool)TempData["AccountAreadyExist"])
                       {
                          <p> Account already exists for faculty...</p>
                       }
                    <h3>Faculty List</h3>
                    <p>
                        @Html.ActionLink("Create New", "Create", null, new { @class = "btn" })
                    </p>
                    
                    <div class="datagrid">
                        <table id="box-table-a">
                            <tr>
                                <th>
                                    @Html.DisplayNameFor(model => model.Title)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.FullName)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.PhoneNumber)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.Email)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.Address)
                                </th>
                                <th></th>
                            </tr>

                            @foreach (var item in Model)
                            {
                                <tr>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Title)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.FullName)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.PhoneNumber)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Email)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Address)
                                    </td>
                                    <td>
                                        @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                                        @Html.ActionLink("Details", "Details", new { id = item.Id }) |
                                        @Html.ActionLink("Create Account", "CreateAccount", new { id = item.Id }) |
                                        @Html.ActionLink("Delete", "Delete", new { id = item.Id })
                                    </td>
                                </tr>
                            }

                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
